﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CarLeasing.Models;

namespace CarLeasing.Forms.Controls
{
    public partial class CarDetailView : UserControl
    {
        public CarDetailView()
        {
            InitializeComponent();
        }

        public void ShowCar(CarInfo car)
        {
            if (car != null)
            {
                label_Brand.Text = car.Brand;
                label_ModelType.Text = car.ModelType;
                label_Price.Text = car.Price;
                label_Type.Text = car.Type;
                label_Origin.Text = car.Origin;
                label_Body.Text = car.Body;
                label_Gear.Text = car.Gear;
            }
            else
            {
                label_Brand.Text = "";
                label_ModelType.Text = "";
                label_Price.Text = "";
                label_Type.Text = "";
                label_Origin.Text = "";
                label_Body.Text = "";
                label_Gear.Text = "";
            }
        }
    }
}
